/*
 * Copyright 2018 The JA-SIG Collaborative. All rights reserved.
 * distributed with thi file and available online at
 */
package com.lap.scp.admin.utils;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

/**
 * <pre>
 *
 * </pre>
 * 
 * @author 劳水生 Exp
 * @Date 2018年9月21日 下午11:17:42
 * @since 1.0
 */
public abstract class ListUtils {

	/**
	 * 字符串转换成integer集合
	 * 
	 * @param str
	 * @return
	 */
	public static List<Integer> strToIntList(String str) {
		if (StringUtils.isNotBlank(str)) {
			List<Integer> result = new LinkedList<>();
			String[] strArray = str.split(",");
			for (String st : strArray) {
				if (StringUtils.isNotBlank(str)) {
					Integer id = Integer.parseInt(st.trim());
					result.add(id);
				}
			}
			return result;
		} else {
			return Collections.emptyList();
		}
	}

}
